﻿@{
    ViewData["Title"] = "FanTian";
    Layout = null;
}

<link rel="stylesheet" href="~/layui/css/layui.css">
@*引用*@
<script src="~/Scripts/jquery-3.4.1.min.js"></script>
<script src="~/layer/Model/appsettings.js"></script>
<script src="~/layui/layui.js"></script>

<div style="width:800px">
    <form class="layui-form" action="/Job/updaterole">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input id="Id" name="Id" type="hidden" value="@ViewBag.id" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">职位名称：</label>
            <div class="layui-input-block">
                <input type="text" id="Name" name="Name" required lay-verify="required" placeholder="请输入职位名称" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">所属部门：</label>
            <div class="layui-input-block">
                <select id="Deptid" name="Deptid" lay-filter="aihao">
                    <option value="0">-</option>
                    <option value="1">地球物流有限公司</option>
                    <option value="2">财务部</option>
                    <option value="3">人事部</option>
                    <option value="4">市场部</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">别名：</label>
            <div class="layui-input-block">
                <input type="text" id="Aliases" name="Aliases" required lay-verify="required" placeholder="请输入别名" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" type="submit" lay-submit>立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary" onclick="tz()">返回</button>
            </div>
        </div>
    </form>
</div>

<script>
        //Demo
    layui.use('form', function(){
      var form = layui.form;
      form.render();
      //监听提交

      form.on('submit(formDemo)', function(data){
      });
    });

    var tz=function(){
        location.href="/Job/Index"
    }

        $(function () {
            $.ajax({
                url: "/Job/GetBack?id=" + @ViewBag.id,
                type: "get",
                dataType: "json",
                success: function (obj) {
                    console.info(obj)
                    $("#Name").val(obj.name)
                    $("#Deptid").val(obj.deptid)
                    $("#Aliases").val(obj.aliases)
                }
            })
        })
</script>
